/**
 * 
 */
package com.curso.sesion11;

/**
 * @author MATEUS
 *
 */
public class StringGame {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		String cadena = "  zabc def de de de  ";
		System.out.println(cadena.charAt(1));
		String cadena2 = "ghi";
		System.out.println(cadena.concat(cadena2));
		String cadena3 = "GHI";
		
		System.out.println("compareTo: " + cadena2.compareTo(cadena3));
		System.out.println("compareTo: " + cadena.compareTo(cadena3));
		
		System.out.println("endsWith: " + cadena.endsWith("defx"));
		
		System.out.println("equals: " + cadena3.equals(cadena2));
		System.out.println("equalsIgnoreCase: " + cadena3.equalsIgnoreCase(cadena2));
		System.out.println("== :" + cadena3 == cadena2);
		
		System.out.println("indexOf: " + cadena.indexOf("de"));
		
		System.out.println("lastIndexOf: " + cadena.lastIndexOf("de"));
		
		System.out.println("length: "+cadena.length());
		
		System.out.println("replace: "+cadena.replace("e", "@"));
		
		System.out.println("startsWith: " + cadena.startsWith("zabc"));
		
		System.out.println("substring: " + cadena3.substring(1));
		System.out.println("substring: " + cadena3.substring(1, 2));
		
		System.out.println("toLowerCase: "+cadena.toLowerCase());
		System.out.println("toUpperCase: "+cadena.toUpperCase());
		
		System.out.println("trim: "+cadena.trim());
		
		String a = "esto no cambia nunca mas";
		System.out.println(a);
		a = a.toUpperCase();
		System.out.println(a);
		
		String s1 = "abc";
		String s2 = "abc";
		String s3 = new String("abc");
		String s4 = "abc";
		
		System.out.println(s1 == s4);
		System.out.println(s3 == s4);
		
		
	}

}
